home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 130_01 / bios.lib < prev    next >
Text File  |  1985-03-09  |  1KB  |  63 lines

  1. ;
  2. ; BDS C Standard Library Machine Language Functions  v1.44  4/2/81
  3. ;
  4. ; Modifications by Rick Hollinbeck (*RH*):
  5. ;    bios modified to not alter hl for the seldsk function (9)
  6. ;
  7. ;
  8. ; Bios:
  9. ;
  10. ;    bios(n,c)
  11. ;
  12. ; Call to bios jump table routine n, with BC set to c. n=0 for boot,
  13. ; n=1 for wboot, n=2 for const, etc.
  14. ;
  15.     prelude    bios
  16.     
  17.     call arghak    
  18.     push b
  19.     lhld base+1    ;get addr of jump table + 3
  20.     dcx h        ;set to addr of first jump
  21.     dcx h
  22.     dcx h
  23.     lda arg1    ;get function number (1-85)
  24.     mov b,a        ;multiply by 3
  25.     add a
  26.     add b
  27.     mov e,a        ;put in DE
  28.     mvi d,0
  29.     dad d        ;add to base of jump table
  30.     push h        ;and save for later
  31.     lhld arg2    ;get value to be put in BC
  32.     mov b,h        ;and put it there
  33.     mov c,l
  34.     reloc <lxi h,>,retadd    ;where call to bios will return to
  35.     xthl        ;get address of vector in HL
  36.     pchl        ;and go to it...
  37. retadd:
  38. ; *RH* Modified to leave hl alone for seldsk
  39. ;
  40.     push psw
  41.     push h
  42.     lxi h,arg1    ;check for seldsk
  43.     mvi a,9        ;seldsk
  44.     cmp m
  45.     pop h
  46.     reloc jz, nomod
  47.     pop psw
  48.     mov l,a        ;all done. now put return value in HL
  49.     mvi h,0
  50.     reloc jmp, biosret
  51. nomod:    pop psw
  52. biosret: pop b
  53.     ret        ;and return to caller
  54.  
  55.     postlude bios
  56.  hl for the seldsk function (9)
  57. ;
  58. ;
  59. ; Bios:
  60. ;
  61. ;    bios(n,c)
  62. ;
  63. ; Call to bios jump table routine n, with B